package com.nian.search.solr.dao;

import com.nian.search.solr.model.SolrItem;
import org.apache.solr.client.solrj.SolrQuery;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.solr.repository.Query;
import org.springframework.data.solr.repository.SolrCrudRepository;
import org.springframework.stereotype.Repository;

import java.util.Optional;

/**
 * 用途：
 * 开发：zhangmj
 * 日期：2020/4/14 0014 11:49
 */
@Repository
public interface SolrItemRepository extends SolrCrudRepository<SolrItem, String> {

    Optional<SolrItem> findById(String id);

    @Override
    Page<SolrItem> findAll(Pageable pageable);

    @Query("title:?")
    Page<SolrItem> findByQueryAnnotation(String title, Pageable pageable);



}
